import request from '@/utils/request'
import {
  getToken
} from '@/utils/auth'

// 查询代理人列表
export function listAgent(query) {
  return request({
    url: '/award/agent/list',
    method: 'get',
    params: query
  })
}

// 批量修改代理人分组
export function updateGroup(data) {
  return request({
    url: '/award/agent/updateGroup',
    method: 'post',
    data: data
  })
}

// 批量更新or新增分组
export function importFile() {
  let url = process.env.VUE_APP_BASE_API + '/award/agent/updateGroup/import';
  let token = 'Bearer ' + getToken();
  let headers = {
    "Authorization": token
  }
  return {
    url,
    headers
  }
}

// 冻结用户邀请资格
export function freezeInviteState(userId,data) {
  return request({
    url: '/award/agent/freeze/'+userId,
    method: 'post',
    data: data
  })
}
